import java.io.File;

/**
 * Author: Daniel Michalski
 * Date: 24.03.13
 */

public class DirList {
    public static void main(String[] args) {
        String dirname = "Samochód";
        File f1 = new File(dirname);

        if (f1.isDirectory()) {
            System.out.println("Katalog: " + dirname);
            String[] s = f1.list(new OnlyJpgFilter("jpg"));

            for (int i = 0; i < s.length; i++) {
                File f = new File(dirname + "/" + s[i]);
                if (f.isDirectory())
                    System.out.println(s[i] + " jest katalogiem");
                else
                    System.out.println(s[i] + " jst plikime");
            }
        } else {
            System.out.println(dirname + " nie jest katalogiem");
        }

        File file = new File("cos");
        file.mkdir();

    }
}

